﻿define(['util', 'ajax'], function (util, ajax) {
    "use strict";

    var exports = {}, ViewModel;

    ViewModel = function () {
        var self = this;

        self.emailaddress = ko.observable();

        self.recoverPassword = function () {
            var form = {
                userNameOrEmailAddress: self.emailaddress(),
            };
            ajax.del('authRecovery', form).done(function (response) {
                if (response.isSuccess == true) {
                    util.notify.info("Recover Password Successfully");
                }
            });
        };
    };
    exports.exec = function () {
        var viewModel = new ViewModel();
        ko.applyBindings(viewModel, document.getElementById('mainMenu'));
    };

    return exports;
});